package com.example.common.entity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author Destinycc
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ExcpErrResult<T> implements Serializable {
    private String msg;

    private Integer code;

    private T data;

    @Override
    public String toString() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("msg", this.msg);
        jsonObject.put("code", this.code);
        jsonObject.put("data", this.data);
        return jsonObject.toJSONString();
    }
}
